package cn.iocoder.yudao.module.dify.dal.mysql.riskreportrecords;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dify.dal.dataobject.riskreportrecords.RiskReportRecordsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dify.controller.admin.riskreportrecords.vo.*;

/**
 * dify风险管理报告任务记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface RiskReportRecordsMapper extends BaseMapperX<RiskReportRecordsDO> {

    default PageResult<RiskReportRecordsDO> selectPage(RiskReportRecordsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RiskReportRecordsDO>()
                .eqIfPresent(RiskReportRecordsDO::getFileId, reqVO.getFileId())
                .likeIfPresent(RiskReportRecordsDO::getOriginalName, reqVO.getOriginalName())
                .eqIfPresent(RiskReportRecordsDO::getExtension, reqVO.getExtension())
                .eqIfPresent(RiskReportRecordsDO::getMimeType, reqVO.getMimeType())
                .eqIfPresent(RiskReportRecordsDO::getDifyRequestId, reqVO.getDifyRequestId())
                .eqIfPresent(RiskReportRecordsDO::getDifyDownloadUrl, reqVO.getDifyDownloadUrl())
                .eqIfPresent(RiskReportRecordsDO::getDifyResponse, reqVO.getDifyResponse())
                .eqIfPresent(RiskReportRecordsDO::getMinioUrl, reqVO.getMinioUrl())
                .eqIfPresent(RiskReportRecordsDO::getProcessStatus, reqVO.getProcessStatus())
                .eqIfPresent(RiskReportRecordsDO::getRetryCount, reqVO.getRetryCount())
                .eqIfPresent(RiskReportRecordsDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(RiskReportRecordsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RiskReportRecordsDO::getId));
    }

}